package design.proxy.static_proxy;

/**
 * 代理类实现和实体类同样的接口
 * 静态代理类
 */
public class ProxyUser implements User {
    private UserImpl userImpl;

    public ProxyUser(UserImpl userImpl) {
        this.userImpl = userImpl;
    }

    @Override
    public void save(String username) {
        System.out.println("代理类增强功能: Before");
        userImpl.save(username);
        System.out.println("代理类增强功能: After");
    }
}
